﻿using Newtonsoft.Json;
using System.Collections.Generic;

namespace AutomationCommand
{
    public class wb_gst_elmt_wit_opt : BasiCommand
    {
        [JsonProperty("xpath1")]
        public string XPath1 { get; set; }

        [JsonProperty("xpath2")]
        public List<XPath2> XPath2List { get; set; }

        [JsonProperty("datkey")]
        public string DatKey { get; set; }

        [JsonProperty("overtime")]
        public int Overtime { get; set; }

        [JsonProperty("count_s")]
        public int CountS { get; set; }

        [JsonProperty("count_d")]
        public int CountD { get; set; }

        [JsonProperty("opt")]
        public int Option { get; set; }

        public wb_gst_elmt_wit_opt()
        {
            FunctionType = "wb_gst_elmt_wit_opt";
            OtherName = "幽灵元素操作";
            SuccessJump = -1;
            FailureJump = -1;
            XPath1 = "";
            XPath2List = new List<XPath2>();
            DatKey = "test";
            Overtime = 10000;
            CountS = 0;
            CountD = 0;
            Option = 0;
        }

        public bool Execute()
        {
            // 在这里编写执行命令的逻辑
            // 返回执行结果
            return true; // 假设此处始终成功
        }
    }

    public class XPath2
    {
        [JsonProperty("xpath")]
        public string XPath { get; set; }

        [JsonProperty("datatb")]
        public string DataTb { get; set; }

        [JsonProperty("ckatb")]
        public string CkAtb { get; set; }

        [JsonProperty("ckkey")]
        public string CkKey { get; set; }

        [JsonProperty("sndkey")]
        public string SndKey { get; set; }
    }
}
